function scrollAnime(y, time, xValue){
	var x = 0;
	if(xValue != undefined && xValue != null){
		x = xValue;
	}
	

	if(typeof(y) == "object" || y.toString().indexOf("HTML") >= 0 || y.toString().indexOf("Element") >= 0){
		//this means y is a [object HTML Element]
		var element = y;
		y = element.offsetTop;
		//user can set x and y == a [object HTML Element]
		if(x == 0){
			x = element.offsetLeft ;
		}
	}
	/*
	 * The X Y in this screen is window.scrollX & Y
	 * if window.scrollY = 500, y = 400 , I should let the scroll of Y == -100
	 * if window.scrollY = 400, y = 500 , I should let the scroll of Y ==  100
	 */
	y = y - window.scrollY;
	x = x - window.scrollX;
		
	var wholeTime = 1000;		//how long to display the scroll animation

	if(time != undefined && time != null){
		wholeTime = time;
	}

	var animeTimes = 10;		//how many times to do the "setScroll" function
	animeTimes = Math.round(Math.log(wholeTime / 100) / Math.log(10)) * 10;
	if(animeTimes == 0){
		animeTimes = 10;
	}
   
	var eachTimeOfAnime = wholeTime / animeTimes;
	var eachTimeScrollToX = x / animeTimes;
	var eachTimeScrollToY = y / animeTimes;
	
	for(var i = 1; i < (animeTimes + 1) ; i++){
		var timeFunction = "window.scrollTo(" + ( window.scrollX + (i * eachTimeScrollToX) ) + " , " + ( window.scrollY + (i * eachTimeScrollToY) ) + ");";
		setTimeout(timeFunction ,(i * eachTimeOfAnime));
	}
}
